Crate hostname

source ·
Expand description

A crate with utilities to get and set the system’s host name.

§Examples

Set and get the host name:

hostname::set("potato")?;
let new_name = hostname::get()?;
assert_eq!(new_name, OsStr::new("potato"));

Functions§

  • Return the system hostname.
  • setset
    Set the system hostname.